-
-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve codecs priority #1144
Preserve codecs priority #1144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix makes perfect sense but the implementation does not work as-is. For instance, when RTP maps are added or removed with addRtpMap()
or removeRtpMap()
you must update the ordered payload types, otherwise descriptions created this way are broken. For consistency, you should remove the payload types that are not in the map after parsing the media description (statically-assigned codecs are not supported), and payloadTypes()
should also return the ordered payload types.
|
||
private: | ||
virtual string generateSdpLines(string_view eol) const override; | ||
|
||
int mBas = -1; | ||
|
||
std::map<int, RtpMap> mRtpMaps; | ||
std::vector<string> mCodecsOrder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should contain integers as they are payload types, and I would suggest renaming it to a more explicit mOrderedPayloadTypes
:
std::vector<string> mCodecsOrder; | |
std::vector<int> mOrderedPayloadTypes; |
@@ -885,7 +885,9 @@ void Description::Application::parseSdpLine(string_view line) { | |||
Description::Media::Media(const string &sdp) : Entry(get_first_line(sdp), "", Direction::Unknown) { | |||
string line; | |||
std::istringstream ss(sdp); | |||
std::getline(ss, line); // discard first line | |||
std::getline(ss, line); | |||
parseFirstLine(line); // save codecs order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method parses the first line a second time, which is not ideal.
string word; | ||
std::getline(ss, word, ' '); // audio | ||
std::getline(ss, word, ' '); // 9 | ||
std::getline(ss, word, ' '); // UDP/TLS/RTP/SAVPF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic here is different from the one in Entry()
, meaning the behavior can be inconsistent, for instance if there are two consecutive spaces.
Any news on this? |
Closing due to inactivity. |
No description provided.